package db

import (
	"database/sql"
	"log"
)

func  InitMysqlDb()( db *sql.DB){


	//初始化数据库连接池
	db, _ = sql.Open("mysql", "root:leaniot@tcp(mysql:3306)/leaniot?parseTime=true")
	db.SetMaxOpenConns(200)
	db.SetMaxIdleConns(5)
	err := db.Ping()
	if err != nil {
		log.Fatalln("DB PING: ", err)
	}
	return db
}
